package com.carter.springframework.beans.factory.config;

import java.util.HashMap;
import java.util.Map;

/**
 * 用来包装和集合PropertyValue的类
 */
public class PropertyValues {
    private Map<String, PropertyValue> propertyValueMap = new HashMap<>();

    public void addPropertyValue(PropertyValue propertyValue){
        propertyValueMap.put(propertyValue.getName(),propertyValue);
    }

    public PropertyValue getPropertyValue(String name){
        return propertyValueMap.get(name);
    }

    public PropertyValue[] getPropertyValues(){
        return propertyValueMap.values().toArray(new PropertyValue[0]);
    }
}
